import axios from 'axios';

export const uploadToGithub = (filename,base64Img) => {
    const URL = `https://api.github.com/repos/zhang-1947/cdn/contents/admin/${filename}`;
    return axios({
        url: URL,
        method: 'put',
        headers: {
            Accept: "application/vnd.github.v3+json",
            Authorization: 'token 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'
        },
        data:{
            "message":"test1",
            "committer": {
                "name": "zhang-1947",
                "email": "3063537882@qq.com"
            },
            "content":base64Img
        }
    });
};